// 元组类型
let pos: number[] = [34.815397, 113.897001];
let position: [number, number] = [34.815397, 113.897001];

let ag = 22;

//断言类型: 编译为js在html引入
// let box0 = <HTMLAnchorElement>document.getElementById("box");

// let box = document.getElementById("box") as HTMLAnchorElement;
// console.log(box);

//
function changeDirection(dire: "Up" | "Down" | "Left" | "Right") {
  console.log(dire);
}
changeDirection("Down");

enum DirectionEnum {
  Up,
  Down,
  Left,
  Right,
}
function changeDirection2(dire: DirectionEnum) {
  console.log(dire);
}
console.log(DirectionEnum);

changeDirection2(DirectionEnum.Down);

console.log(typeof "admin");
console.log(typeof DirectionEnum);

class A {
  name: string;
  age: number;
}

class B {
  name: string = "a";
  age: number = 1;
  sex: string = "male";
}
let a: A = new B();
console.log(a);
